#include "PatientAcceptor.h"

PatientAcceptor::PatientAcceptor(InetAddress &addr, Reactor * reactor)
  : acceptor_(addr), reactor_(reactor)
{
  reactor->registerHandler(this, ACCEPT_EVENT);
}

void PatientAcceptor::handleEvent (Handle h, EventType et)
{
  if (et == ACCEPT_EVENT)
    {
      SocketStream * clientConnection = new SocketStream();
      acceptor_.accept(*clientConnection);
      PatientHandler * ph = new PatientHandler(clientConnection, reactor_);
    }

}

Handle PatientAcceptor::getHandle() const
{
  return acceptor_.getHandle();
}
